package org.skyeye.modeling.commands;
import org.eclipse.gef.commands.Command;
import org.skyeye.modeling.model.MBase;
import org.skyeye.modeling.model.MNode;
public class DeleteNodeCommand extends Command {

	private MBase root;

	private MNode sub;

	//private int index;

	public void setRoot(MBase root) {
		this.root = root;
	}

	public void setNode(MNode sub) {
		this.sub = sub;
	}

	//------------------------------------------------------------------------
	// Overridden from Command

	public void execute() {
		this.root.removeChild(sub);
	}

	public String getLabel() {
		return "";
	}

	public void redo() {
		execute();
	}

	public void undo() {
		this.root.addChild(sub);
	}
}